;;;Finds layers having linetypes with embedded text and changes their
;;;linetype to continuous.
;;;
;;;	AUTHOR:
;;;		HENRY C. FRANCIS
;;;		425 N. ASHE ST.
;;;		SOUTHERN PINES, NC 28387
;;;
;;;		All rights reserved.
;;;	web: http://paracadd.com/
;;;
;;;  Copyright: 5/25/01
;;;     Edited: 5/25/01
;;;
(defun c:etlt2cont ( / lt_name lt_def ltype_lst ltsrch_lst la_name la_lst)
  (setq oldregenmode (getvar"regenmode"))
  (setvar "regenmode" 0)
  (if wipeprom nil (load "wipeprom" "\nFile WIPEPROM.LSP not found! "))
  (tblnext "ltype" T)
  (princ "\n  Finding linetypes with embedded text... ")
  (while (setq lt_name (tblnext "ltype" nil))
    (setq lt_def (entget (tblobjname "Ltype" (cdr (assoc 2 lt_name)))))
    (if (assoc 9 lt_def)
      (if ltype_lst
        (setq ltype_lst (append ltype_lst (list (cdr (assoc 2 lt_def)))))
        (setq ltype_lst (list (cdr (assoc 2 lt_def))))
      )
    )
  )
  (if ltype_lst
    (progn
      (setq ltsrch_lst (mapcar '(lambda (x) (cons 6 x)) ltype_lst))
      (setq la_name (tblnext "layer" T))
      (if (member (cdr (assoc 6 la_name)) ltype_lst)
        (setq la_lst (list (cons 8 (cdr (assoc 2 la_name)))))
      )
      (wipeprom)
      (princ "  Finding layers with those linetypes... ")
      (while (setq la_name (tblnext "layer" nil))
        (if (member (cdr (assoc 6 la_name)) ltype_lst)
          (if la_lst
            (setq la_lst (append la_lst (list (cons 8 (cdr (assoc 2 la_name))))))
            (setq la_lst (list (cons 8 (cdr (assoc 2 la_name)))))
          )
        )
      )
(IF
  (AND
    (NOT (TBLSEARCH "LTYPE" "WIREFENCE"))
    (FINDFILE "coop.lin")
  ) ;_ end of AND
   (COMMAND "linetype"
            "load"
            "WIREFENCE"
            "acad.lin"
            ""
   ) ;_ end of command
) ;_ end of if
      (if la_lst
        (progn
          (wipeprom)
          (PRINC "  Setting linetype to continuous for those layers... ")
          (foreach n la_lst
	    (if (wcmatch (STRCASE (CDR n)) "*FENCE*")
              (command ".layer" "lt" "wirefence" (cdr n) "")
              (command ".layer" "lt" "continuous" (cdr n) "")
	    )
          )
        )
        (progn
          (wipeprom)
          (princ "  No layers found with those linetypes!                               ")
        )
      )
    )
    (progn
      (wipeprom)
      (princ "  No linetypes found with embedded text!                              ")
    )
  )
  (setvar "regenmode" oldregenmode)
  (princ)
)
(princ)
